class Startup < ActiveRecord::Migration
  def self.up
	  create_table "positions" do |t|
		  ("a".."h").each do |col|
			  (1..8).each do |row|
				  t.column "#{col}#{row}", :string, :limit => 1, :default => " "
				end
			end
			t.column "move", :string, :limit => 6
			t.column "parent_id", :integer
			t.column "game_id", :integer
		end

		create_table "games" do |t|
			t.column "player1", :string
			t.column "player2", :string
			t.column "result",	:string, :limit => 3
		end
  end

  def self.down
		drop_table "positions"
		drop_table "games"
  end
end
